#ifndef __AIRKISS_H_
#define __AIRKISS_H_
#include <sys/types.h>
#include <stdint.h>

#define BIT(x)  (1 << (x))
#define MAX_BUF_SIZE	(1<<9)
#define ETH_ALEN	6

enum AIRKISS_STATUS {
	PREAMBLE_RXD = 1,
	MAGIC_RXD = 2,
	PREFIX_RXD = 4,
};

struct airkiss_context {
	int pream_cnt;
	int seq_step;
	uint8_t seq_no; 
	uint8_t seq_no_crc;
	int base_len;
	uint8_t buf[MAX_BUF_SIZE];
	uint8_t index[MAX_BUF_SIZE];
	int pos;
	int total_len, total_len_saved;
	uint8_t random;
	int pass_len;

	int status;
	uint8_t ssid_crc, ssid_crc_saved;
	uint8_t pass_crc;

	uint8_t flag;
	int magic_cnt;
	uint8_t addr[ETH_ALEN];
};

int airkiss_recv(struct airkiss_context *ac, uint8_t *packet, int len);


#endif //__AIRKISS_H_
